<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8"/>
	<meta name="keywords" content="File Drop, snippet"/>
	<link rel="stylesheet" href="../../Shared/sty/standard.css"/>
	<script defer src="../../Shared/js/toc.js"></script>
	
	<title>Write insertion format for File Drop in CotEditor on Mac</title>
</head>

<body>

<h1>Write insertion format for File Drop in CotEditor on Mac</h1>

<p>CotEditor has the following variables for the use of File Drop.</p>

<table>
	<caption>Variables for File Drop</caption>
	<thead>
		<tr><th>Variable</th><th>Replaced with</th></tr>
	</thead>
	<tbody>
		<tr><td><code>&lt;&lt;&lt;ABSOLUTE-PATH&gt;&gt;&gt;</code></td><td>The absolute path of the dropped file.</td></tr>
		<tr><td><code>&lt;&lt;&lt;RELATIVE-PATH&gt;&gt;&gt;</code></td><td>The relative path from your document to the dropped file.</td></tr>
		<tr><td><code>&lt;&lt;&lt;FILENAME&gt;&gt;&gt;</code></td><td>The name of the dropped file with extension.</td></tr>
		<tr><td><code>&lt;&lt;&lt;FILENAME-NOSUFFIX&gt;&gt;&gt;</code></td><td>The name of the dropped file without extension.</td></tr>
		<tr><td><code>&lt;&lt;&lt;FILEEXTENSION&gt;&gt;&gt;</code></td><td>The file extension of the dropped file.</td></tr>
		<tr><td style="white-space: nowrap"><code>&lt;&lt;&lt;FILEEXTENSION-LOWER&gt;&gt;&gt;</code></td><td>The file extension of the dropped file (lowercase).</td></tr>
		<tr><td style="white-space: nowrap"><code>&lt;&lt;&lt;FILEEXTENSION-UPPER&gt;&gt;&gt;</code></td><td>The file extension of the dropped file (uppercase).</td></tr>
		<tr><td><code>&lt;&lt;&lt;DIRECTORY&gt;&gt;&gt;</code></td><td>The directory of the dropped file.</td></tr>
		<tr><td style="white-space: nowrap"><code>&lt;&lt;&lt;FILECONTENT&gt;&gt;&gt;</code></td><td>The text content of the dropped file (works only when you drop an text file).</td></tr>
		<tr><td><code>&lt;&lt;&lt;IMAGEWIDTH&gt;&gt;&gt;</code></td><td>The image width (works only when you drop an image file).</td></tr>
		<tr><td><code>&lt;&lt;&lt;IMAGEHEIGHT&gt;&gt;&gt;</code></td><td>The image height (works only when you drop an image file).</td></tr>
	</tbody>
</table>


<p>Here are a few examples of what it’s like to use variables.</p>

<table>
	<caption>example 1) When you drop example.html:</caption>
	<tbody>
		<tr><th>Insertion format you set</th><td><code>&lt;a href=&quot;&lt;&lt;&lt;RELATIVE-PATH&gt;&gt;&gt;&quot;&gt;&lt;/a&gt;</code></td></tr>
		<tr><th>The text actually inserted</th><td><code>&lt;a href=&quot;example.html&quot;&gt;&lt;/a&gt;</code></td></tr>
	</tbody>
</table>

<table>
	<caption>example 2) When you drop example.jpg:</caption>
	<tbody>
		<tr><th>Insertion format you set</th><td><code>&lt;img src=&quot;&lt;&lt;&lt;FILENAME&gt;&gt;&gt;&quot; width=&quot;&lt;&lt;&lt;IMAGEWIDTH&gt;&gt;&gt;&quot; height=&quot;&lt;&lt;&lt;IMAGEHEIGHT&gt;&gt;&gt;&quot; /&gt;</code></td></tr>
		<tr><th>The text actually inserted</th><td><code>&lt;img src=&quot;example.jpg&quot; width=&quot;160&quot; height=&quot;80&quot; /&gt;</code></td></tr>
	</tbody>
</table>


<section id="cf">
<h2>See also</h2>
<ul>
	<li><a href="settings_snippets.html">Change Snippets settings in CotEditor on Mac</a></li>
</ul>
</section>

</body>
</html>
